package com.jsecode.lib.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 对日志的类型进行统一分类
 * 
 * @author luodan
 *
 */
public class LoggerUtil {
    
    /** 配合log4j.properties，对特殊日志文件记录 */
    private static Logger logMonitor = LoggerFactory.getLogger("com.jsecode.common.monitor");
    /** 配合log4j.properties，对特殊日志文件记录 */
    private static Logger logCmd = LoggerFactory.getLogger("com.jsecode.gtp.common.terminalcmd");
    /** 配合log4j.properties，对特殊日志文件记录 */
    private static Logger logNetSend = LoggerFactory.getLogger("com.jsecode.net.send");
    private static Logger logNetRecv= LoggerFactory.getLogger("com.jsecode.net.recv");

    private static Logger logParser= LoggerFactory.getLogger("com.jsecode.common.parser");
    private static Logger logSaver = LoggerFactory.getLogger("com.jsecode.common.saver");
    
    
    /**
     * 记录过期的数据
     */
    public static void logMonitor(String msg) {
        logMonitor.info(msg);
    }

    /**
     * 记录命令行相关信息
     */
    public static void logCmd(String msg) {
        logCmd.info(msg);
    }

    /**
     * 记录发送数据的日志
     */
    public static void logNetSend(String msg) {
        logNetSend.info(msg);
    }

    /**
     * 记录接收数据的日志
     */
    public static void logNetRecv(String msg) {
        logNetRecv.info(msg);
    }
    
    /**
     * 记录parser
     */
    public static void logParser(String msg) {
        logParser.info(msg);
    }

    /**
     * 记录saver
     */
    public static void logSaver(String msg) {
        logSaver.info(msg);
    }
    
    public static Logger getLogNetRecv(){
        return logNetRecv;
    }
    
    public static Logger getLogNetSend(){
        return logNetSend;
    }
    
    public static Logger getLogSaver() {
        return logSaver;
    }
}
